{"ast":null,"code":"/**\n * TODO: 4.0\n *\n * - Remove `dataSource`\n * - `size` not work with customizeInput\n * - CustomizeInput not feedback `ENTER` key since accessibility enhancement\n */\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Select from '../select';\nimport genPurePanel from '../_util/PurePanel';\nimport { isValidElement } from '../_util/reactNode';\nimport warning from '../_util/warning';\nconst {\n  Option\n} = Select;\nfunction isSelectOptionOrSelectOptGroup(child) {\n  return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);\n}\nconst AutoComplete = (props, ref) => {\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    popupClassName,\n    dropdownClassName,\n    children,\n    dataSource\n  } = props;\n  const childNodes = toArray(children);\n  // ============================= Input =============================\n  let customizeInput;\n  if (childNodes.length === 1 && isValidElement(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    [customizeInput] = childNodes;\n  }\n  const getInputElement = customizeInput ? () => customizeInput : undefined;\n  // ============================ Options ============================\n  let optionChildren;\n  // [Legacy] convert `children` or `dataSource` into option children\n  if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    optionChildren = children;\n  } else {\n    optionChildren = dataSource ? dataSource.map(item => {\n      if (isValidElement(item)) {\n        return item;\n      }\n      switch (typeof item) {\n        case 'string':\n          return /*#__PURE__*/React.createElement(Option, {\n            key: item,\n            value: item\n          }, item);\n        case 'object':\n          {\n            const {\n              value: optionValue\n            } = item;\n            return /*#__PURE__*/React.createElement(Option, {\n              key: optionValue,\n              value: optionValue\n            }, item.text);\n          }\n        default:\n          process.env.NODE_ENV !== \"production\" ? warning(false, 'AutoComplete', '`dataSource` is only supports type `string[] | Object[]`.') : void 0;\n          return undefined;\n      }\n    }) : [];\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    process.env.NODE_ENV !== \"production\" ? warning(!('dataSource' in props), 'AutoComplete', '`dataSource` is deprecated, please use `options` instead.') : void 0;\n    process.env.NODE_ENV !== \"production\" ? warning(!customizeInput || !('size' in props), 'AutoComplete', 'You need to control style self instead of setting `size` when using customize input.') : void 0;\n    process.env.NODE_ENV !== \"production\" ? warning(!dropdownClassName, 'AutoComplete', '`dropdownClassName` is deprecated, please use `popupClassName` instead.') : void 0;\n  }\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('select', customizePrefixCls);\n  return /*#__PURE__*/React.createElement(Select, Object.assign({\n    ref: ref\n  }, omit(props, ['dataSource', 'dropdownClassName']), {\n    prefixCls: prefixCls,\n    popupClassName: popupClassName || dropdownClassName,\n    className: classNames(`${prefixCls}-auto-complete`, className),\n    mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE\n  }, {\n    // Internal api\n    getInputElement\n  }), optionChildren);\n};\nconst RefAutoComplete = /*#__PURE__*/React.forwardRef(AutoComplete);\n// We don't care debug panel\n/* istanbul ignore next */\nconst PurePanel = genPurePanel(RefAutoComplete);\nRefAutoComplete.Option = Option;\nRefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;\nexport default RefAutoComplete;","map":{"version":3,"names":["classNames","toArray","omit","React","ConfigContext","Select","genPurePanel","isValidElement","warning","Option","isSelectOptionOrSelectOptGroup","child","type","isSelectOption","isSelectOptGroup","AutoComplete","props","ref","prefixCls","customizePrefixCls","className","popupClassName","dropdownClassName","children","dataSource","childNodes","customizeInput","length","getInputElement","undefined","optionChildren","map","item","createElement","key","value","optionValue","text","process","env","NODE_ENV","getPrefixCls","useContext","Object","assign","mode","SECRET_COMBOBOX_MODE_DO_NOT_USE","RefAutoComplete","forwardRef","PurePanel","_InternalPanelDoNotUseOrYouWillBeFired"],"sources":["/data/messenger.client/node_modules/antd/es/auto-complete/index.js"],"sourcesContent":["/**\n * TODO: 4.0\n *\n * - Remove `dataSource`\n * - `size` not work with customizeInput\n * - CustomizeInput not feedback `ENTER` key since accessibility enhancement\n */\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Select from '../select';\nimport genPurePanel from '../_util/PurePanel';\nimport { isValidElement } from '../_util/reactNode';\nimport warning from '../_util/warning';\nconst {\n  Option\n} = Select;\nfunction isSelectOptionOrSelectOptGroup(child) {\n  return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);\n}\nconst AutoComplete = (props, ref) => {\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    popupClassName,\n    dropdownClassName,\n    children,\n    dataSource\n  } = props;\n  const childNodes = toArray(children);\n  // ============================= Input =============================\n  let customizeInput;\n  if (childNodes.length === 1 && isValidElement(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    [customizeInput] = childNodes;\n  }\n  const getInputElement = customizeInput ? () => customizeInput : undefined;\n  // ============================ Options ============================\n  let optionChildren;\n  // [Legacy] convert `children` or `dataSource` into option children\n  if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    optionChildren = children;\n  } else {\n    optionChildren = dataSource ? dataSource.map(item => {\n      if (isValidElement(item)) {\n        return item;\n      }\n      switch (typeof item) {\n        case 'string':\n          return /*#__PURE__*/React.createElement(Option, {\n            key: item,\n            value: item\n          }, item);\n        case 'object':\n          {\n            const {\n              value: optionValue\n            } = item;\n            return /*#__PURE__*/React.createElement(Option, {\n              key: optionValue,\n              value: optionValue\n            }, item.text);\n          }\n        default:\n          process.env.NODE_ENV !== \"production\" ? warning(false, 'AutoComplete', '`dataSource` is only supports type `string[] | Object[]`.') : void 0;\n          return undefined;\n      }\n    }) : [];\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    process.env.NODE_ENV !== \"production\" ? warning(!('dataSource' in props), 'AutoComplete', '`dataSource` is deprecated, please use `options` instead.') : void 0;\n    process.env.NODE_ENV !== \"production\" ? warning(!customizeInput || !('size' in props), 'AutoComplete', 'You need to control style self instead of setting `size` when using customize input.') : void 0;\n    process.env.NODE_ENV !== \"production\" ? warning(!dropdownClassName, 'AutoComplete', '`dropdownClassName` is deprecated, please use `popupClassName` instead.') : void 0;\n  }\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('select', customizePrefixCls);\n  return /*#__PURE__*/React.createElement(Select, Object.assign({\n    ref: ref\n  }, omit(props, ['dataSource', 'dropdownClassName']), {\n    prefixCls: prefixCls,\n    popupClassName: popupClassName || dropdownClassName,\n    className: classNames(`${prefixCls}-auto-complete`, className),\n    mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE\n  }, {\n    // Internal api\n    getInputElement\n  }), optionChildren);\n};\nconst RefAutoComplete = /*#__PURE__*/React.forwardRef(AutoComplete);\n// We don't care debug panel\n/* istanbul ignore next */\nconst PurePanel = genPurePanel(RefAutoComplete);\nRefAutoComplete.Option = Option;\nRefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;\nexport default RefAutoComplete;"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,YAAY,MAAM,oBAAoB;AAC7C,SAASC,cAAc,QAAQ,oBAAoB;AACnD,OAAOC,OAAO,MAAM,kBAAkB;AACtC,MAAM;EACJC;AACF,CAAC,GAAGJ,MAAM;AACV,SAASK,8BAA8B,CAACC,KAAK,EAAE;EAC7C,OAAOA,KAAK,IAAIA,KAAK,CAACC,IAAI,KAAKD,KAAK,CAACC,IAAI,CAACC,cAAc,IAAIF,KAAK,CAACC,IAAI,CAACE,gBAAgB,CAAC;AAC1F;AACA,MAAMC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